package com.papa91.banner;
import com.papa91.activity.EmuBaseActivity;
import com.qq.e.ads.interstitial.AbstractInterstitialADListener;
import com.qq.e.ads.interstitial.InterstitialAD;

import android.app.Activity;
import android.util.Log;
import android.view.ViewGroup;

public class InterstitialADInfo extends BannerInfo{

	private InterstitialAD iad;
	public InterstitialADInfo(EmuBaseActivity activity, ViewGroup rootView, String adId, String appId, int type) {
		super(activity, rootView, adId, appId, type);
		// TODO Auto-generated constructor stub
	}
	
@Override
public void showAd() {
	// TODO Auto-generated method stub
	  if (iad == null) {
	      iad = new InterstitialAD(activity,appId, adId);
	  
	    //  iad = new BannerView(activity, ADSize.BANNER,appId,adId);
	    //  iad.setRefresh(30);
	      iad.setADListener(new AbstractInterstitialADListener() {

	          @Override
	          public void onNoAD(int arg0) {
	            Log.i("AD_DEMO", "LoadInterstitialAd Fail:" + arg0);
	          }

	          @Override
	          public void onADReceive() {
	              Log.i("AD_DEMO", "onADReceive");
	            iad.show();
	          }
	        });
	}
    this.iad.loadAD();
}
@Override
public void closeAd() {
	// TODO Auto-generated method stub
    iad.closePopupWindow();
}
}
